<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/mx_update/'.$cateid)?>">

	<h3>墨西哥申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td colspan="5">I. PERSONAL DATA个人资料</td>
        </tr>
        <tr class="even">
            <td>1. LAST NAME (as in passport) 姓（和护照上相同）</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>2. FIRST NAME(as in passport) 名（和护照上相同）</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
        </tr>
        <tr class="odd">
            <td>3. PASSPORT NUMBER, place and date of issue</td>
            <td colspan="4">PASSPORT NO. (护照号码)<input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /><br />
			PASSPORT ISSUED AT（护照签发地）<input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /><br />
			DATE OF ISSUE(护照签发日期) <input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /><br />
			EXPIRATION DATE( 护照到期日) ) <input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
        </tr>
        <tr class="even">
            <td>4. CURRENT NATIONALITY 现国籍</td>
            <td><input type="text" name="cur_nationality" value="<?= @$info->cur_nationality?>" /></td>
            <td>&nbsp;</td>
            <td>5. ORIGINAL NATIONALITY 原国籍</td>
            <td><input type="text" name="ori_nationality" value="<?= @$info->ori_nationality?>" /></td>
        </tr>
        <tr class="odd">
            <td>6. PLACE OF BIRTH 出生地</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
			<td>&nbsp;</td>
			<td>7. DATE OF BIRTH 出生日期（年/月/日）</td>
			<td> 
			<select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select> -<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> - <select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select></td>
        </tr>
        <tr class="even">
          <td>8. GENDER性别</td>
		  <td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />Male / 男 &nbsp;&nbsp;<input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />Female / 女</td>
		  <td>&nbsp;</td>
		  <td>9. MARITAL STATUS（婚姻状况）</td>
		  <td>
<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/> Single/单身<br />			
<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/> Married/已婚<br />	
<input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/> Divorced/离异<br />		
<input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/> Widowed/丧偶</td>
        </tr>
        <tr class="odd">
            <td>10. HOME ADDRESS(street, number, city, country, post code)</td>
			<td><input type="text" name="home_address" value="<?= @$info->home_address?>" /></td>
			<td>&nbsp;</td>
			<td>11. CONTACT TELEPHONE NUMBER（联系电话）</td>
			<td>Mobile phone （手机号码）<input type="text" name="mob_tel" value="<?= @$info->mob_tel?>" /><br />
			Home tel. （家庭电话）<input type="text" name="home_tel" value="<?= @$info->home_tel?>" /><br />
			Others （其他电话, 选填）<input type="text" name="other_tel" value="<?= @$info->other_tel?>" /></td>
        </tr>
        <tr class="even">
            <td colspan="5">II. OCUPATION 职务</td>
        </tr>
        <tr class="odd">
            <td>12. CURRENT OCCUPATION （当前职务）</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
            <td>&nbsp;</td>
            <td>13. COMPANY’S NAME（公司名）</td>
            <td><input type="text" name="com_name" value="<?= @$info->com_name?>" /></td>
        </tr>
        <tr class="even">
            <td>14. BUSINESS ADDRESS（公司地址）</td>
            <td><input type="text" name="com_address" value="<?= @$info->com_address?>" /></td>
            <td>&nbsp;</td>
            <td>15. BUSINESS TEL. （公司电话）</td>
            <td><input type="text" name="com_tel" value="<?= @$info->com_tel?>" /></td>
        </tr>
		        <tr class="odd">
            <td>16. YEARS OF SERVICE （入职时间）</td>
            <td><input type="text" name="service_year" value="<?= @$info->service_year?>" /></td>
			<td>&nbsp;</td>
			<td>17. MONTHLY INCOME (USD) 月收入（美元）</td>
            <td><input type="text" name="income" value="<?= @$info->income?>" /></td>
        </tr>
        <tr class="even">
            <td>18. OTHER INCOME (source and amount USD) 其他收入（来源及金额 单位：美元）</td>
            <td><input type="text" name="other_income" value="<?= @$info->other_income?>" /></td>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
        </tr>		
        <tr class="odd">
            <td colspan="5">III. OTHER INFORMATION 其他信息</td>
        </tr>
        <tr class="even">
            <td>19.VALID VISAS FOR OTHER COUNTRIES 他国有效签证</td>
            <td colspan="4">COUNTRY（国家）<input type="text" name="other_visa_country" value="<?= @$info->other_visa_country?>" /> &nbsp;VALIDITY（有效期）<input type="text" name="other_visa_validity" value="<?= @$info->other_visa_validity?>" /><br />
			Visas obtained (valid & expired) 是否有下列签证: 
 <input type="radio" name="has_country" value="1" <?= (@$info->has_country==1)?'checked':''?>/> USA （美国）
 <input type="radio" name="has_country" value="2" <?= (@$info->has_country==2)?'checked':''?>/> CANADA （加拿大）
 <input type="radio" name="has_country" value="3" <?= (@$info->has_country==3)?'checked':''?>/> EUROPE （欧洲）</td>
        </tr>
        <tr class="odd">
            <td>20. Place of entry into MEXICO入境地点</td>
			<td><input type="text" name="entry_place" value="<?= @$info->entry_place?>" /></td>
			<td>&nbsp;</td>
			<td>21. Date of entry入境日期</td>
			<td><input type="text" name="entry_date" value="<?= @$info->entry_date?>"  id="entry_date"/></td>
        </tr>
        <tr class="even">
            <td>22.Main purpose 行程主要目的</td>
            <td colspan="4">
			<input type="radio" name="journey_purpose" value="1" <?= (@$info->journey_purpose==1)?'checked':''?>/> Tourism / 旅游 
			<input type="radio" name="journey_purpose" value="2" <?= (@$info->journey_purpose==2)?'checked':''?>/> Transit 过境 
			<input type="radio" name="journey_purpose" value="3" <?= (@$info->journey_purpose==3)?'checked':''?>/> Business 商务
            <input type="radio" name="journey_purpose" value="4" <?= (@$info->journey_purpose==4)?'checked':''?>/> Technician 技术访问<br> 
			<input type="radio" name="journey_purpose" value="5" <?= (@$info->journey_purpose==5)?'checked':''?>/> Studies 学习 
			<input type="radio" name="journey_purpose" value="6" <?= (@$info->journey_purpose==6)?'checked':''?>/> Work 工作
            <input type="radio" name="journey_purpose" value="7" <?= (@$info->journey_purpose==7)?'checked':''?>/> Permant residency 定居 
			<input type="radio" name="journey_purpose" value="8" <?= (@$info->journey_purpose==8)?'checked':''?>/> Visiting family 探亲 <br>
            <input type="radio" name="journey_purpose" value="0" <?= (@$info->journey_purpose==0)?'checked':''?>/> Other其他（请说明）
			<input type="text" name="journey_purpose_other" value="<?= @$info->journey_purpose_other?>" /></td>
        </tr>

        <tr class="odd">
            <td>23. Main destination in MEXICO 主要目的地</td>
            <td><input type="text" name="destination" value="<?= @$info->destination?>" /></td>
            <td>&nbsp;</td>
            <td colspan="2">24. Length of stay in MEXICO（停留时间）<input type="text" name="stay_length" value="<?= @$info->stay_length?>" /><br />
			Date of travel （计划出发日期）<input type="text" name="travel_date" value="<?= @$info->travel_date?>" id="travel_date" /></td>
        </tr>
        <tr class="even">
            <td>25. Who will furnish financial support （谁将承担访墨费用）?</td>
            <td><input type="text" name="who_support" value="<?= @$info->who_support?>" /></td>
            <td>&nbsp;</td>
            <td>26.Name & address of sponsor/firm in MEXICO墨方担保人或公司的名字及地址</td>
            <td><input type="text" name="sponsor" value="<?= @$info->sponsor?>" /></td>
        </tr>
        <tr class="odd">
            <td>27.Other cities to visit 还要经过或访问的城市</td>
            <td colspan="4"><input type="text" name="other_city" value="<?= @$info->other_city?>" style="width:300px" /></td>
            </tr>
		<tr class="even">
            <td>28. If visiting the northern border of MEXICO是否前往北部边界</td>
            <td colspan="4"><input type="radio" name="is_northern" value="0" <?= (@$info->is_northern==0)?'checked':''?>/> No
&nbsp;&nbsp;<input type="radio" name="is_northern" value="1" <?= (@$info->is_northern==1)?'checked':''?>/> Yes</td>
        </tr>
        <tr class="odd">
            <td>29. Indicate cities 城市名称</td>
            <td><input type="text" name="north_city" value="<?= @$info->north_city?>" /></td>
			<td>&nbsp;</td>
			<td>30. Purpose 目的</td>
			<td><input type="text" name="north_purpose" value="<?= @$info->north_purpose?>" /></td>
        </tr>
		
		<tr class="even">
            <td>31. If visiting the southern border of MEXICO是否前往南部边界</td>
            <td colspan="4"><input type="radio" name="is_southern" value="0" <?= (@$info->is_southern==0)?'checked':''?>/> No
&nbsp;&nbsp;<input type="radio" name="is_southern" value="1" <?= (@$info->is_southern==1)?'checked':''?>/> Yes</td>
        </tr>
        <tr class="odd">
            <td>32. Indicate cities 城市名称</td>
            <td><input type="text" name="south_city" value="<?= @$info->south_city?>" /></td>
			<td>&nbsp;</td>
			<td>33. Purpose 目的</td>
			<td><input type="text" name="south_purpose" value="<?= @$info->south_purpose?>" /></td>
        </tr>
		
        <tr class="even">
            <td>34. Have you ever applied for a Mexican visa before以前是否申请过墨西哥签证</td>
            <td><input type="radio" name="is_applied" value="0" <?= (@$info->is_applied==0)?'checked':''?>/>
No&nbsp;&nbsp;
<input type="radio" name="is_applied" value="1" <?= (@$info->is_applied==1)?'checked':''?>/>
Yes</td>
			<td>&nbsp;</td>
			<td>35. The former application was 之前申请被</td>
			<td><input type="radio" name="applied_result" value="1" <?= (@$info->applied_result==1)?'checked':''?>/> Authorized 批准
&nbsp;&nbsp;<input type="radio" name="applied_result" value="2" <?= (@$info->applied_result==2)?'checked':''?>/> Refused 拒绝</td>
        </tr>
        <tr class="odd">
            <td>36. If you entered MEXICO before, please indicate 如果您以前曾入境墨西哥，请填写:</td>
            <td colspan="4">Place and date of the entry 入境的地点和时间<br />
            	<input type="text" name="entered_before" value="<?= @$info->entered_before?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
            <td>What kind of immigration documents did you get? 您有过其他移民手册是</td>
			<td colspan="4">
 <input type="radio" name="has_doc" value="1" <?= (@$info->has_doc==1)?'checked':''?>/> FM3 O Validity 有效期<input type="text" name="doc1_date" value="<?= @$info->doc1_date?>" /> <br />
 <input type="radio" name="has_doc" value="2" <?= (@$info->has_doc==2)?'checked':''?>/> FM2 O Validity 有效期<input type="text" name="doc2_date" value="<?= @$info->doc2_date?>" /><br />
 <input type="radio" name="has_doc" value="3" <?= (@$info->has_doc==3)?'checked':''?>/> Other 其他 （请说明）<input type="text" name="doc3_name" value="<?= @$info->doc3_name?>" />Validity 有效期<input type="text" name="doc3_date" value="<?= @$info->doc3_date?>" /></td>
        </tr>
        <tr class="odd">
            <td>Place and date of application 申请地及申请日期</td>
            <td colspan="4"><input type="text" name="app_info" value="<?= @$info->app_info?>" style="width:300px" /></td>
        </tr>
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		cur_nationality:"required",
		travel_document_num:"required",
		travel_document_issue_by:"required",
		travel_document_valid_date:"required",
		travel_document_issue_date:"required",
		sex:"required",
		marital_status:"required",
		journey_purpose:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#entry_date").datepicker();
	$("#travel_date").datepicker();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>